﻿/*------------------------------------------------
// File Description: Module DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-02-04 04:32:43
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 权限模块
    /// </summary>
    [Table(nameof(Module))]
    public class Module : BaseEntity
    {
        private string _cNTitle = string.Empty;
        private string _eNTitle = string.Empty;
        private string _vNTitle = string.Empty;
        private string _icon = string.Empty;
        private string _url = string.Empty;

        #region Public Property

        ///<Summary>
        /// 中文标题
        ///</Summary>
        public string CNTitle
        {
            get { return string.IsNullOrWhiteSpace(_cNTitle) ? string.Empty : _cNTitle; }
            set { _cNTitle = value; }
        }

        ///<Summary>
        /// 英文标题
        ///</Summary>
        public string ENTitle
        {
            get { return string.IsNullOrWhiteSpace(_eNTitle) ? string.Empty : _eNTitle; }
            set { _eNTitle = value; }
        }

        ///<Summary>
        /// 越文标题
        ///</Summary>
        public string VNTitle
        {
            get { return string.IsNullOrWhiteSpace(_vNTitle) ? string.Empty : _vNTitle; }
            set { _vNTitle = value; }
        }

        ///<Summary>
        /// 图标
        ///</Summary>
        public string Icon
        {
            get { return string.IsNullOrWhiteSpace(_icon) ? string.Empty : _icon; }
            set { _icon = value; }
        }

        ///<Summary>
        /// 地址
        ///</Summary>
        public string Url
        {
            get { return string.IsNullOrWhiteSpace(_url) ? string.Empty : _url; }
            set { _url = value; }
        }

        ///<Summary>
        /// 排序序号
        ///</Summary>
        public int SortNo { get; set; }

        ///<Summary>
        /// 部门ID
        ///</Summary>
        public int DepartmentId { get; set; }

        ///<Summary>
        /// 父级ID
        ///</Summary>
        public int ParentId { get; set; }

        ///<Summary>
        /// 支持匿名访问
        ///</Summary>
        public bool Anonymous { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 权限模块
        /// </summary>
        public virtual DbSet<Module> Modules { get; set; }
    }
}